<?php

namespace App\Http\Middleware;

use Closure;

class CheckToken
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request $request
     * @param  \Closure $next
     * @param  $param
     * @return mixed
     */
//    public function handle($request, Closure $next)
//    {
////        if ($request->input('token') == 'yfl') {
////            return redirect()->to('http://www.baidu.com');
////        }
//        echo '请求前执行';
//        return $next($request);
//    }
    public function handle($request, Closure $next, $param)
    {
        var_dump($param);
        $response = $next($request);
        echo '请求后执行';
        return $response;
    }
}
